﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Members.ascx.cs" Inherits="controls_admin_Members" %>
<!-- table -->
<script type="text/javascript">
    $(document).ready(function () {
        if ($("#<%=hdfDialog.ClientID %>").val() != "0") {
            $("#dialog-form").dialog("open");
        }
        $("#edit").click(function () {
            $("table input[type=checkbox].item").each(function () {
                var checked = $(this).attr("checked");
                if (checked) {
                    window.location.replace(window.location.pathname + "?module=membersedit&m_id=" + $(this).val());
                }
            });
        });
        $("#<%=btnDel.ClientID %>").click(function () {
            var ids = "";
            $("table input[type=checkbox].item").each(function () {
                var checked = $(this).attr("checked");
                if (checked) {
                    ids = ids + $(this).attr("value") + ";";
                }
            });
            if (ids == "") {
                return false;
            }
            else {
                $("#<%=hdfID.ClientID %>").val(ids);
                return true;
            }
        });
    });
</script>
<div id="dialog-form" title="Chi tiết thành viên">
    <p>
        Thành viên:
        <asp:Literal runat="server" ID="ltrUserName" />
        .</p>
    <div class="form">
        <div class="fields">
            <div class="field field-first">
                <div class="label">
                    <label for="input">
                        Mã thành viên:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrMemberCode" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        Tên đầy đủ:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrFullName" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        Địa chỉ:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrAddress" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        FAX:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrFax" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        Số điện thoại:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrPhone" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        Email:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrEmail" runat="server" />
                </div>
            </div>
            <div class="field">
                <div class="label">
                    <label for="input">
                        Số dư tài khoản:</label>
                </div>
                <div class="input">
                    <asp:Literal ID="ltrMonney" runat="server" />
                </div>
            </div>
        </div>
    </div>
</div>
<div class="box">
    <asp:HiddenField runat="server" ID="hdfID" Value="" />
    <asp:HiddenField runat="server" ID="hdfDialog" Value="0" />
    <!-- box / title -->
    <div class="title">
        <h5 id="title" runat="server">
            Danh Sách Thành Viên</h5>
        <div class="search">
            <div class="input">
                <input id="txtSearch" runat="server" style="width: 200px" value="Hãy nhập từ khóa !"
                    onclick='if(this.value=="Hãy nhập từ khóa !")this.value=""' onblur='if(this.value=="")this.value="Hãy nhập từ khóa !"' />
            </div>
            <div class="button">
                <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click" />
            </div>
        </div>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <div id="divResult" class="result" runat="server">
    </div>
    <div class="first-action">
    </div>
    <!-- end box / title -->
    <div class="table">
        <table>
            <thead>
                <tr>
                    <th>
                        STT
                    </th>
                    <th>
                        Tên tài khoản
                    </th>
                    <th>
                        Tên đầy đủ
                    </th>
                    <th>
                        Email
                    </th>
                    <th>
                        Tài khoản
                    </th>
                    <th class="selected last">
                        <input type="checkbox" class="checkall" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptData" runat="server" OnItemCommand="rptData_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <%#(Container.ItemIndex+1)+(base.Cur_page-1)*base.Page_size %>
                            </td>
                            <td align="center">
                                <asp:Button runat="server" Text='<%#Eval("USER_NAME")%>' CssClass="details" ToolTip="Chỉnh sửa"
                                    CommandArgument='<%#Eval("MEMBER_ID")%>' CommandName="dialog" ID="btnDialog" />
                            </td>
                            <td align="center">
                                <%#Eval("FULL_NAME")%>
                            </td>
                            <td align="center">
                                <%#Eval("EMAIL")%>
                            </td>
                            <td align="center">
                                <%#Eval("LEFT_MONEY")%>
                            </td>
                            <td align="center" class="last">
                                <input type="checkbox" value='<%#Eval("MEMBER_ID")%>' class="item" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
        <div class="pagination pagination-left last">
            <div class="pagerContainer" id="pagerContainer" runat="server">
            </div>
        </div>
        <div class="action">
            <div class="button">
                <input id="edit" value="Sửa" type="button" />
                <asp:Button ID="btnDel" runat="server" Text="Xóa" OnClick="btnDel_Click" />
            </div>
        </div>
    </div>
</div>
<!-- end table -->
